/*
 *  field_info.h
 *
 *  Copyright (C) 2011  Jason<linux8192@gmail.com>
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _FIELD_INFO_H_
#define _FIELD_INFO_H_

#include "type.h"
#include "attribute_info.h"
#include "constant_info.h"

#define FIELD_INFO_ACC_PUBLIC			0x0001
#define FIELD_INFO_ACC_PRIVATE			0x0002
#define FIELD_INFO_ACC_PROTECTED		0x0004
#define FIELD_INFO_ACC_STATIC			0x0008
#define FIELD_INFO_ACC_FINAL			0x0010
#define FIELD_INFO_ACC_VOLATILE			0x0040
#define FIELD_INFO_ACC_TRANSIENT		0x0080

#define FIELD_INFO_SIZE_WITHOUT_ATTR_LIST	8

typedef struct _field_info {
	u2	access_flags;
	u2	name_index;
	u2	descriptor_index;
	u2	attributes_count;
	attr_t	*attributes[0];
} field_info_t;

field_info_t **parse_fields_info(char *buff, const int field_cnt, const cp_info_t **cp_list, int *len);

#endif /* _FIELD_INFO_H_ */
